#ifndef INPUT_PIPELINE_H
#define INPUT_PIPELINE_H

#define kb(a) input_pipeline::self()->_kb(a)
#define kb_up() input_pipeline::self()->update()
#define kb_mx() input_pipeline::self()->_kb_mouse_x()
#define kb_my() input_pipeline::self()->_kb_mouse_y()
#define kb_wx() input_pipeline::self()->_kb_mouse_wx()
#define kb_wy() input_pipeline::self()->_kb_mouse_wy()

#define KB_QUIT 0
#define KB_FORWARD 1
#define KB_BACKWARD 2
#define KB_LEFT 3
#define KB_RIGHT 4
#define KB_ESCAPE 5
#define KB_M1 32
#define KB_M2 33
#define KB_M3 34
#define KB_LENGHT 35	//kolko ich je

#define KB_STATUS_PRESSED 1
#define KB_STATUS_CHANGED 2

#include "SDL/SDL.h"
#include <queue>
#include "render_pipeline.h"

using namespace std;

class input_pipeline{
	private:
		input_pipeline();
		SDL_Event event;

		char kb_SDL_map[512];				//ked dostanem SDL input ktory moj input to je
		unsigned char kb_map[KB_LENGHT];	//asi nepotrebne - ktory moj input znamena ktory SDL input
		char kb_map_status[KB_LENGHT];		//ako je na tom ktory moj input

		void addkey (unsigned char, unsigned char);
		double mouse_x,mouse_y;
	
	public:
		static input_pipeline * self();

		int load_settings();
		int save_settings();
		
		void update ();
		
		unsigned char _kb(unsigned char);
		double _kb_mouse_x(){return mouse_x;}
		double _kb_mouse_y(){return mouse_y;}
		double _kb_mouse_wx();
		double _kb_mouse_wy();

};

#endif
